package com.hoshiicloud.market.feign;

import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.market.feign.hystrix.HystrixGoodsFeignFallback;
import com.hoshiicloud.saleorder.param.customer.ExtSkuQueryParam;
import com.hoshiicloud.user.dto.customer.SkuDTO;
import com.hoshiicloud.user.entity.customer.ExtSku;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;
import java.util.Map;

/**
 * @program: hoshiicloud
 * @description: 商品服务 获取sku信息
 * @author: Mr.wu
 * @create: 2019-05-18 17:35
 **/
@FeignClient(name="hoshiicloud-goods",fallbackFactory = HystrixGoodsFeignFallback.class)
public interface GoodsService {
    @RequestMapping(value = "/goods/ext-sku/{id}",method = RequestMethod.GET)
    public Response<ExtSku> getGoodsDetailById(@PathVariable("id") String skuId);

    @GetMapping(value = "/goods/ext-sku/getByIds")
    public Response<List<ExtSku>> getGoodsDetailByIds(List<Long> param);

    @RequestMapping(value = "/goods/ext-sku/query/page",method = RequestMethod.POST)
    public Response getGoodsPage(ExtSkuQueryParam param);

    @RequestMapping(value = "/goods/sku-info/getSkuStockByIds",method = RequestMethod.POST)
    public Response<Map<Long, SkuDTO>> querySKuStockByIds(List<Long> ids);

    @RequestMapping(value = "/goods/sku-info/getExtSku",method = RequestMethod.POST)
    public Response<SkuDTO> getExtSku(Long id);
}
